<script language="javascript" src="<?php echo base_url(); ?>application/views/hospitalizacion/js/hospitalizacion.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>media/jquery/jquery.min.js"></script>
<form class="form-horizontal well">
    
    <legend>Asignación de habitaciones Hospitalización</legend>
        <div class="row-fluid" style="margin-bottom: 50px">
            <div class="span8" >
                <div class="control-group">
                    <label class="control-label" for="nCita"><strong>N° de cita</strong></label>
                    <div class="controls">
                        <input type="text" placeholder="Ingrese un número de cita" onkeypress="return validar_numeros(event)" class="input-xlarge" id="NOrdenModal" maxlength="4">
                    </div>
                </div>
            
                <div class="control-group">
                    <label class="control-label" for="paciente"><strong>Nombres Paciente</strong></label>
                    <div class="controls">
                        <input type="text" placeholder="Ingrese nombres del paciente" class="input-xlarge" id="paciente" maxlength="30">
                    </div>
                </div>
      
                <?php $idFecIni="idFecIni";
                latisoft_datePicker_nuevo($idFecIni,'<strong>Fecha Inicial</strong> ','dd-mm-yyyy','',true);?>
             
               <?php $idFecFin="idFecFin";
                latisoft_datePicker_nuevo($idFecFin,'<strong>Fecha Final</strong> ','dd-mm-yyyy','',true);?>
             
             </div>
            <div class="span4">
                <a class="btn btn-primary" onclick="buscarOrdenes()">Buscar</a>
             </div>
       </div>
        <div style="margin-bottom: 50px" data-toggle="collapse" data-target="#acordion2">
            <div id="tablaModal"></div>
        </div>

        <!--<div id="acordion2" class="collapse on">-->
        <!--MENSAJE DE CONTROL--->
        <div id="mensajeControl" style="display: none">
            <button type="button" class="close" data-dismiss="alert">×</button>
        </div>
        <div id="aparece" style="display: none">
            <legend>Detalle</legend>
            <div class="row-fluid">
                <div class="span6">
                    <div class="control-group">
                        <label class="control-label" for="numOrden"><strong>N° Cita</strong></label>
                        <div class="controls"><input type="text" disabled class="input-xlarge" id="numOrden"></div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="nombres"><strong>Nombres</strong></label>
                        <div class="controls"><input type="text" disabled class="input-xlarge" id="nombres"></div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="especialidad"><strong>Especialidad</strong></label>
                        <div class="controls"><input type="text" disabled class="input-xlarge" id="especialidad"></div>
                    </div>
                </div>
                <div class="span6">
                    <div class="control-group">
                        <label class="control-label" for="doctor"><strong>Doctor</strong></label>
                        <div class="controls"><input type="text" disabled class="input-large" id="doctor"></div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="fechaIni"><strong>Fecha cita</strong></label>
                        <div class="controls"><input type="text" disabled class="input-large" id="fechaIni"></div>
                    </div>
                    <div class="row-fluid">
                        <label class="control-label" for="cama"><strong> Código Cama</strong></label>
                        <div class="controls">
                            <input type="text" disabled class="input-small" id="cama">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="#myModal" role="button" class="btn btn-success" data-toggle="modal" onclick="limpiarDatosModal()"><strong>Cama</strong></a>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="controls"><input type="hidden" id="fila"></div>
                    </div>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span12">
                    <div class="form-actions">
                        <a class="btn btn-primary" onclick="insertarConsulta_Cama()" > Asignar Cama</a>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none;width:700px;">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h3 id="myModalLabel">Seleccionar Cama</h3>
            </div>
            <div class="modal-body" style="height:550px;">
                <div class="row-fluid">
                    <div class="span12">
                        <div class="control-group"></div>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span2">
                    </div>
                    <div class="span6">
                        <div class="control-group">
                            <label class="control-label"><strong>Ambiente</strong></label>
                            <div class="controls">
                                <?php  
                                    $js = ' id=ambiente1 class ="input-large chzn-select" onchange="ambi1()"';
                                    echo form_dropdown('ambiente1', $comboAmbiente, NULL, $js); 
                                ?>
                            </div>
                        </div>
                        <div class="control-group" id="sitio1">
                            
                        </div>
                        <div class="control-group" id="sitio2">
                            
                        </div>
                    </div>
                    <div class="span4">
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span4">
                        <div class="control-group"></div>
                    </div>
                    <div class="span8">
                        <a class="btn btn-primary center" onclick="asignarCama()" data-dismiss="modal" aria-hidden="true"> Asignar Cama</a>
                    </div>
                </div>
            </div>
        </div>
</form>

<style type="text/css">
.tr_hover_color {background-color: #ffccee}
.tr_hover_nothing {background-color: white}
</style>